# -*- coding: utf-8 -*-
from tkGrid import *
import xmlrpclib
#import pickle
import tkMessageBox as msgBox
try:
    from xTkinter import *
except:
    print >> sys.stderr, 'Le module xTkinter est  introuvable'  
    sys.exit(1)
import sys

class Vue_ReglesAffaires(Frame):
    def __init__(self, master,parent,**cnf):
        KeysList=cnf.keys()
        self.parent = parent
        self.master=master
        self.width=400
        self.height=200
        if ('width' in KeysList):
            self.width=cnf['width']
        if ('width' in KeysList):
            self.height=cnf['height']
        Frame.__init__(self,master,cnf)        
        self.config(bg='#6B979C',relief='raised',bd=3)
        # CREATION DU CADRE     
        self.pack(side=LEFT,anchor=NW)
        
        self.configure(width=786,height=381)
        # CREATION DU GUI RÈGLES D'AFFAIRES
#        self.Condition_List_Box=xListbox(self,text='Condition',height=1,width=8)
#        self.Condition_List_Box.place(x=9,y=174)
#        self.Condition_Label=xLabel(self,text='Condition',height=1,width=8)
#       self.Condition_Label.place(x=9,y=153)
#        self.Table_Operande_Gauche=xListbox(self,text='Table1',height=1,width=20)
#        self.Table_Operande_Gauche.place(x=64,y=174)
        self.Table1_Label=xLabel(self,text='Table1',height=1,width=20)
        self.Table1_Label.place(x=65,y=153)
#        self.Attribut1_Label=xLabel(self,text='Attribut 1',height=1,width=20)
#        self.Attribut1_Label.place(x=193,y=153)
#        self.Attribut_Operande_Droite=xListbox(self,text='Attribut 1',height=1,width=20)
#        self.Attribut_Operande_Droite.place(x=193,y=174)
#        self.Comparaison_Label=xLabel(self,text='Comparaison',height=1,width=10)
#        self.Comparaison_Label.place(x=321,y=153)
#        self.Comparaison_List_Box=xListbox(self,text='Opérateur',height=1,width=10)
#        self.Comparaison_List_Box.place(x=321,y=174)
#        self.Table_Operande_Droite=xListbox(self,text='Table 2',height=1,width=25)
#        self.Table_Operande_Droite.place(x=389,y=174)
#        self.Table2_Label=xLabel(self,text='Table 2',height=1,width=25)
#        self.Table2_Label.place(x=389,y=153)
#        self.Attribut2_Label=xLabel(self,text='Attribut 2',height=1,width=25)
#        self.Attribut2_Label.place(x=547,y=153)
        self.Attribut_Operande_Droite=xCombobox(self,text='Attribut 2',height=1,width=25)
        self.Attribut_Operande_Droite.place(x=547,y=174)
#        self.Operande_Droite_Label=xLabel(self,text='Opérande Droite',height=1,width=25)
#        self.Operande_Droite_Label.place(x=489,y=124)
#        self.Operande_Gauche_Label=xLabel(self,text='Opérande gauche',height=1,width=25)
#        self.Operande_Gauche_Label.place(x=145,y=124)
#        self.Regles_Affaires_Label=xLabel(self,text='Règles d''affaires',height=1,width=20)
#        self.Regles_Affaires_Label.place(x=11,y=39)
#        self.Regles_Affaires_List_Box=xListbox(self,text='Règles d''affaires',height=1,width=20)
#        self.Regles_Affaires_List_Box.place(x=138,y=39)
#        self.Conseils_Label=xLabel(self,text='Conseils',height=1,width=10)
#        self.Conseils_Label.place(x=196,y=304)
#        self.Conseils_Text=xText(self,text='Conseils',height=1,width=50)
#        self.Conseils_Text.place(x=263,y=304)
#        self.Message_Erreur_Text=xText(self,text='Message d''erreur',height=1,width=50)
#        self.Message_Erreur_Text.place(x=262,y=263)
#        self.Message_Erreur_Label=xLabel(self,text='Message d''erreur',height=1,width=20)
#        self.Message_Erreur_Label.place(x=135,y=263)
#        self.Creer_Button=xButton(self,text='Créer',height=1,width=10)
#        self.Creer_Button.place(x=267,y=38)
        self.Sauvegarder_Button=xButton(self,text='Sauvegarder',height=1,width=12)
        self.Sauvegarder_Button.place(x=267,y=67)
#        self.Quitter_Button=xButton(self,text='Quitter',height=1,width=12)
#        self.Quitter_Button.place(x=618,y=299)
#        self.Supprimer_Button=xButton(self,text='Supprimer',height=1,width=12)
#        self.Supprimer_Button.place(x=372,y=68)
#        self.Annuler_Button=xButton(self,text='Annuler',height=1,width=12)
#        self.Annuler_Button.place(x=618,y=260)
        pass

    def Quitter(self):
        #if MsgBox.askokcancel("Attention", "Vous annulez l'ouverture de session."):
        self.destroy()
        pass
    
    def close(self):
        self.destroy()
        pass